<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/mytag.tld" prefix="f"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	int pageNum = (Integer) request.getAttribute("pageNum");
	int allpage = (Integer) request.getAttribute("allpage");
	int allCounts = (Integer) request.getAttribute("allCounts");
	List allComment = (List) request.getAttribute("allComment");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
	<HEAD>
		<base href="<%=basePath%>">
		<TITLE>北京 17113.cc</TITLE>
		<META http-equiv=Content-Type content="text/html; charset=gb2312">
		<LINK href="css/style.css" type=text/css rel=stylesheet>
		<script language="javascript" src="admin/js/calander.js"></script>
<SCRIPT>
function SetAllCheck(formObj, checkName) {
	var obj = eval("formObj."+checkName+";");
	if ( obj != null ) 
		for (var i=0; i<obj.length; i++) {
			obj[i].checked = formObj.allOper.checked;
		}
}

function doOperate(flag) {	
	var para = "";
    var ids = document.getElementsByName("comIdList");
    for (var i=0;i<ids.length;i++ ){
     if(ids[i].checked){ //判断复选框是否选中
            para = para + ids[i].value + ",";
          }
    }	
	if (confirm("确定要执行该操作吗?")) {
		window.location.href="doJok.do?opers2=doOperate&flag="+ flag +"&ids=" + para;
	} else {
		return;
	}		
}

function doDel(){
	var para = "";
    var ids = document.getElementsByName("comIdList");
    for (var i=0;i<ids.length;i++ ){
     if(ids[i].checked){ //判断复选框是否选中
            para = para + ids[i].value + ",";
          }
    }	
	if (confirm("确定要执行该操作吗?删除后不可恢复！")) {
		window.location.href="doJok.do?opers2=doDel&ids=" + para;
	} else {
		return;
	}
}
</SCRIPT>

		<META content="MSHTML 6.00.3790.2440" name=GENERATOR>
	</HEAD>
	<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=7>
	<form action="/doJok.do?opers2=getAllComment" method="post" id="form1" name="form1">
		<TABLE cellSpacing=0 cellPadding=0 width=800 align=center border=0>
			<TBODY>
				<TR>
					<TD align="center">						
						<IMG height=59 src="admin/img/logo-r.gif">
					</TD>
				</TR>
				<TR>
					<TD vAlign=top background=images/list-bg.jpg>
						<BR>
						<BR>
						<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>	
								<TR>
									<TD>
									<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
												<TR>
													<td colspan=3 align="center" bgColor=#b4b4b4 height=24>
														<font size="3">评论管理</font>																					
													</td>
												</TR>
												<TR>
													<td align=center>
														&nbsp;&nbsp;按状态查询：<select name="flag" id="flag">
															<option value="2" <%=request.getParameter("flag").equals("2") ? "selected"
							: ""%>>所有</option>
															<option value="1" <%=request.getParameter("flag").equals("1") ? "selected"
							: ""%>>已通过</option>
															<option value="0" <%=request.getParameter("flag").equals("0") ? "selected"
							: ""%>>未审核</option>
														</select>														
													</td>
													<td align=center>
														<input type="submit" value="查    询" />
													</td>	
													<td align=center>
														[<A style="FONT-SIZE: 12pt; COLOR: #000099"
															href="/admin/adminIndex.jsp">返回控制台</A>]
													</td>													
												</TR>
										</TABLE>
									</TD>
								</TR>
								<tr>
									<td>
										<table width="100%" border="1" cellspacing="1" cellpadding="0"
											bgcolor="737373" bordercolor="#FFFFFF">
											<tr>
												<td>
													<table width="100%" border="0" cellspacing="0"
														cellpadding="0">
														<tr>
															<td bgcolor="B4B4B4" height="20" align="center">
																总共<%=allCounts%>条 第<%=pageNum%>/<%=allpage%>页（每页显示10条）
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<TR>
									<TD>
										<TABLE cellSpacing=0 cellPadding=1 width="100%" border=1>
											<TBODY>
												<TR align="center">														
													<TD class=text width=100 bgColor=#eff8e0 height=25>
														选中
													</TD>
													<TD class=text width=500 bgColor=#eff8e0 height=25>
														内容
													</TD>
													<TD class=text width=150 bgColor=#eff8e0 height=25>
														发表日期
													</TD>
													<TD class=text width=100 bgColor=#eff8e0 height=25>
														状态
													</TD>
												</TR>
												<c:forEach var="com" items="<%=allComment%>">
													<TR align="center">
														<TD width=200 bgColor=#ffffff>
															<input type="checkbox" name="comIdList" value="${com.id}">
														</TD>
														<TD width=200 bgColor=#ffffff>
															${com.content}
														</TD>	
														<TD width=150 bgColor=#ffffff>
															${com.subDate}
														</TD>											
														<td width=100 bgColor=#ffffff>															
															<c:if test="${com.flag == '0' }">
															<font color="red">审核中</font>
															</c:if>
															<c:if test="${com.flag == '1' }">
															<font color="green">已通过</font>
															</c:if>
														</td>													
													</TR>
												</c:forEach>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
						<tr>
							<td>
								<table width="100%" border="1" cellspacing="1" cellpadding="0"
									bgcolor="737373" bordercolor="#FFFFFF">
									<tr>
										<td>
											<table width="100%" border="0" cellspacing="0"
												cellpadding="0">
												<tr>
													<td bgcolor="B4B4B4" height="20" align="center">
														<f:fenye className="doJok" para="opers2" functionName="getAllComment&flag=${param.flag}"
															pageNum="<%=pageNum%>" totalPage="<%=allpage%>" />
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<TR>
								<TD>
									<TABLE cellSpacing=0 cellPadding=1 width="100%" border="0">
										<TBODY>
											<TR>
												<td>
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													<input type="checkbox" name="allOper"
														onClick="SetAllCheck(this.form, 'comIdList')">
													<font color="#FF0000">全部选中</font>
												</td>
												<td align="right" colspan="5">
													<input type="button" name="operFlag" value=" 批量审核通过 "
														onClick="javascript:doOperate('1');"> ||
													<input type="button" name="operFlag1" value=" 批量执行删除 "
														onClick="javascript:doDel()">
												</td>
											</TR>
										</TBODY>
									</TABLE>
								</TD>
							</TR>								
						</TABLE>
						<BR>
					</TD>
				</TR>
			</TBODY>
		</TABLE>	
		<TABLE cellSpacing=0 cellPadding=5 width=800 align=center border=0>
			<TBODY>
				<TR>
					<TD bgColor=#b4b4b4 height=10>
						&nbsp;
					</TD>
				</TR>
				<TR>
					<TD align=middle>
						版权所有®2011 北京17113.cc. 保留所有权利. 冀ICP备11028198号
					</TD>
				</TR>
			</TBODY>
		</TABLE>
	</form>
	</BODY>
</HTML>





